const mongoose = require('mongoose')
const Schema = mongoose.Schema

// 存储文章信息的集合
const demoCollection = new Schema(
  {
    name: { type: String, required: true },
    url: { type: String, required: true },
    github: { type: String, required: true },
    description: { type: String, required: true },
    thumb: { type: String, required: true },
    order: { type: Number, required: true },
  },
  {
    toJSON: { virtuals: true, getters: true}
  }
)

const Demo = mongoose.model('Demo', demoCollection)

module.exports = Demo
